import request from '@/utils/request';
import type { BasicMsg } from '@/types';

// 上传文件
export const uploadFile = (file: File): Promise<BasicMsg & { data?: string }> => {
  const formData = new FormData();
  formData.append('file', file);
  
  return request({
    url: '/api/files/upload',
    method: 'post',
    data: formData,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  });
};
